---
title: Advanced Formula Engine
icon: '#pro/Sigma'
---

<MetaData
  lang="en-US"
  isPro
  meta={{
    preset: [{
      client: '@univerjs/preset-sheets-advanced',
      locale: '@univerjs/preset-sheets-advanced/locales/en-US',
      style: '@univerjs/preset-sheets-advanced/lib/index.css',
    }],
    plugins: [{
      client: '@univerjs-pro/engine-formula',
      facade: '@univerjs-pro/engine-formula/facade',
    }],
    server: 'No',
  }}
/>

<Callout type="info">
  This is the Univer Pro advanced formula engine docs. For the open-source version, see [here](/guides/sheets/features/core/formula).
</Callout>

The Advanced Formula Engine optimizes the original formula engine, providing improved calculation performance and richer functionality. It supports a variety of complex formula calculations, can handle large datasets, and offers better error handling and debugging capabilities.

## Preset Mode

The Advanced Formula Engine is included in the `@univerjs/preset-sheets-advanced` preset.

### Installation

<Callout>
  The `UniverSheetsAdvancedPreset` preset from `@univerjs/preset-sheets-advanced` depends on the `UniverSheetsDrawingPreset` preset at runtime. Please install `@univerjs/preset-sheets-drawing` first.
</Callout>

```package-install
npm install @univerjs/preset-sheets-drawing @univerjs/preset-sheets-advanced
```

### Usage

```typescript
import { UniverSheetsAdvancedPreset } from '@univerjs/preset-sheets-advanced' // [!code ++]
import UniverPresetSheetsAdvancedEnUS from '@univerjs/preset-sheets-advanced/locales/en-US' // [!code ++]
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'
import UniverPresetSheetsCoreEnUS from '@univerjs/preset-sheets-core/locales/en-US'
import { UniverSheetsDrawingPreset } from '@univerjs/preset-sheets-drawing' // [!code ++]
import UniverPresetSheetsDrawingEnUS from '@univerjs/preset-sheets-drawing/locales/en-US' // [!code ++]
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'

import '@univerjs/preset-sheets-core/lib/index.css'
import '@univerjs/preset-sheets-drawing/lib/index.css' // [!code ++]
import '@univerjs/preset-sheets-advanced/lib/index.css' // [!code ++]

const { univerAPI } = createUniver({
  locale: LocaleType.En_US,
  locales: {
    [LocaleType.En_US]: mergeLocales(
      UniverPresetSheetsCoreEnUS,
      UniverPresetSheetsDrawingEnUS, // [!code ++]
      UniverPresetSheetsAdvancedEnUS, // [!code ++]
    ),
  },
  presets: [
    UniverSheetsCorePreset(),
    UniverSheetsDrawingPreset(), // [!code ++]
    UniverSheetsAdvancedPreset(), // [!code ++]
  ],
})
```

If you have a commercial license for Univer, please refer to [Using License in Client](/guides/pro/license#in-preset-mode) for configuration.

{/* ### Presets and Configuration */}

## Plugin Mode

### Installation

```package-install
npm install @univerjs-pro/engine-formula
```

### Usage

By using the Advanced Formula Engine, you need to replace the original `UniverFormulaEnginePlugin` with `UniverProFormulaEnginePlugin`.

```typescript
import { UniverProFormulaEnginePlugin } from '@univerjs-pro/engine-formula' // [!code ++]
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula' // [!code --]

univer.registerPlugin(UniverFormulaEnginePlugin) // [!code --]
univer.registerPlugin(UniverProFormulaEnginePlugin) // [!code ++]
```

If you have a commercial license for Univer, please refer to [Using License in Client](/guides/pro/license#in-plugin-mode) for configuration.

{/* ### Plugins and Configuration */}
